CROSSCOMPILE := arm-linux-

CFLAGS 	:= -Wall -O2 -c
CFLAGS  += -I$(PWD)/include 

# for 100ask imx6ull
CFLAGS += -I /home/yao/100ask_imx6ull-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/include/freetype2

# for 100ask stm32mp157
CFLAGS += -I /home/yao/100ask_stm32mp157_pro-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/arm-buildroot-linux-gnueabihf/sysroot/usr/include/freetype2

LDFLAGS := -lm -lfreetype

CC 	:= $(CROSSCOMPILE)gcc
LD 	:= $(CROSSCOMPILE)ld

OBJS := main.o \
			chen_display/display_manager.o        \
			chen_display/fb.o                  \
			chen_encoding/ascii.o              \
			chen_encoding/utf16-be.o           \
			chen_encoding/encoding_manager.o   \
			chen_encoding/utf-8.o              \
			chen_encoding/utf16-le.o           \
			chen_draw/draw.o                   \
			chen_fonts/ascii.o                 \
			chen_fonts/gbk.o                   \
			chen_fonts/freetype.o              \
			chen_fonts/fonts_manager.o

all: $(OBJS)
	$(CC) $(LDFLAGS) -o show_file $^

clean:
	rm -f show_file
	rm -f $(OBJS)

%.o:%.c
	$(CC) $(CFLAGS) -o $@ $<

